package com.example.service.impl;


import com.example.mapper.UserMapper;
import com.example.pojo.User;
import com.example.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;




@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;
    private String admin_name;
    private String admin_password;
    private String salt;

    @Override
    public List<User> findUsers() {
        return userMapper.findUsers();
    }

    @Override
    public User findUserByUserName(String username) {
        return userMapper.findUserByUserName(username);
    }

    @Override
    public List<String> getPermissions(String username) {
        return userMapper.getPermissions(username);
    }
    @Override
    public void saveUser(String admin_name,String admin_password,String salt){
        userMapper.saveUser(admin_name,admin_password,salt);}

    @Override
    public void saveUser_row(String username, String password) {
        userMapper.saveUser_row(username, password);
    }

    @Override
    public void saveToken(String admin_name, String token) {
        userMapper.saveToken(admin_name,token);
    }


}
